package com.factory.method_factory.order;

import com.factory.method_factory.pizza.*;

public class LDOrderPizza extends OrderPizza {
    @Override
    public Pizza createPizza(String pizzaType) {
        Pizza pizza = null;
        if (pizzaType.equals("cheese")) {
            pizza = new LDCheesePizza();
            pizza.setName("伦敦奶酪披萨");
        } else if (pizzaType.equals("pepper")) {
            pizza = new LDPepperPizza();
            pizza.setName("伦敦胡椒披萨");
        } else {
            throw new RuntimeException("未找到该种类披萨");
        }
        return pizza;
    }
}
